#define _CRT_SECURE_NO_WARNINGS 1


class Solution {
public:
    int FindGreatestSumOfSubArray(vector<int> array)
    {
        vector<int> v(array, size(), 0);
        v[0] = array[0];
        int maxn = v[0];
        for (int i = 1; i < array.size(); i++)
        {
            v[i] = max(v[i - 1] + array[i], array[i]);
            maxn = max(maxn, v[i]);
        }
        return maxn;
    }
};